<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    {strip}
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="{$design}style/main.css" rel="stylesheet" type="text/css">
        <link href="{$design}style/papers.css" rel="stylesheet" type="text/css">
        <link href="{$design}style/center_content.css" rel="stylesheet" type="text/css">
        <script type="text/javascript" src="{$design}js/main.js"></script>
        <title>Вебсайт Романчика Валерия Станиславовича</title>
    </head>
    <body>
        {include file="globals/head.html"}
        <div class="mainCenter" align="center">
            <div class="mainCenterContent">
                <div class="mainCenterContentLeft">
                    <div class="leftContentBgTop">
                    </div>
                    <div class="leftContentBgCenter" align="center">
                        <div class="postList">
                            <div class="postListItem">
                                <div class="postListItemReturn">
                                    <a href="javascript: history.go(-1);"> << Вернуться назад </a>
                                </div>
                                <div class="postListItemPostedTime" align="left">
                                    <div class="postedTimeBgLeft">
                                    </div>
                                    <div class="postedTimeBgCenter">
                                        {$new.postdate} , {$new.author}
                                    </div>
                                    <div class="postedTimeBgRight">
                                    </div>
                                </div>
                                <span style="clear: left"></span>
                                <div class="postListItemHeader">
                                    <h2>  {$new.caption}  </h2>
                                </div>
                                <div class="postListItemRedLine">
                                </div>
                                <div class="postListItemContent" align="left">
                                    {assign var="previewImgWidth" value=156}
                                    {assign var="previewImgHeight" value=156}
                                    {if $new.image.width>$new.image.height}
                                    {if $new.image.width>$previewImgWidth}
                                    {assign var="newWidth" value=$previewImgWidth}
                                    {assign var="newHeight" value=`$new.image.height/$new.image.width*$previewImgHeight`}
                                    {else}
                                    {assign var="newWidth" value=$new.image.width}
                                    {assign var="newHeight" value=$new.image.height}
                                    {/if}
                                    {else}
                                    {if $new.image.height>$previewImgHeight}
                                    {assign var="newHeight" value=$previewImgHeight}
                                    {assign var="newWidth" value=`$new.image.width/$new.image.height*$previewImgWidth`}
                                    {else}
                                    {assign var="newWidth" value=$new.image.width}
                                    {assign var="newHeight" value=$new.image.height}
                                    {/if}
                                    {/if}
                                    <img src="{$new.image.url}" class="preview" alt=""  width={$newWidth} height={$newHeight}/>
                                    <p>
                                    {$new.maintext}
                                    </p>
                                </div>
                                {if count($new.tags)>0}
                                    <div class="postListItemTags">
                                        Тэги:&nbsp;
                                        {foreach from=$new.tags item=tag key=key}
                                        <a href="/search/{$tag}/1.html">{$tag}</a>{if $key!=(count($new.tags)-1)},{/if} &nbsp;
                                        {/foreach}
                                    </div>
                                {/if}
                                <div class="commentForm">
                                    {if $loginTooShort == true}
                                        <p class="error"> Your nickname is too short. Turn on your imagination! </p>
                                    {/if}
                                    {if $textTooShort == true}
                                        <p class="error"> The text entered is too short. Fluders will burn in the Hellfire! </p>
                                    {/if}
                                    {if $ok == true}
                                        <p class="accept"> Your comment is succesfully added. Thanks for yuor opinion! </p>
                                    {/if}
                                        <form action="" method="POST" class="loginForm">
                                            <p> Nickname </p>
                                            <input type="text" name="login" class="commentLogin"/>
                                            <p> Comment </p>
                                            <textarea cols="45" rows="10" name="commentText"></textarea>
                                                {if $capcha == true}
                                                    <div class="capcha">
                                                        <img src="/gifCapcha/index.php?id={$rand}" id="capcha" alt=""/>
                                                        <div class="capchaInputs">
                                                        <p> Enter the text on the  picture. </p>
                                                        <input type="text" name="capchaText"/>
                                                        <input type="button" name="capchaRefresh" class="button" value="Refresh" onclick="refreshCapcha();"/>
                                                        </div>
                                                        <br/>
                                                        <span style="clear: both;"> </span>
                                                    </div>
                                                    {if $badCapcha == true}
                                                        <p class="error"> Wrong text entered. Try again. </p>
                                                    {/if}
                                                {/if}
                                                    
                                                    
                                                
                                    
                                            <input type="submit" name="submit" value="Send" class="button"/>
                                        </form>
                                </div> 
                                {if count($comments)>0}
                                    <div class="postListItemRedLine">
                                    </div>
                                {/if}
                                <div class="postListItemComments" align="left">
                                    {foreach from=$comments item=commentItem}
                                        <div class="comment">
                                            <div class="commentHeader">
                                                <div class="commentIcon">
                                                </div>
                                                <p>
                                                    {$commentItem.postdate}, {$commentItem.username}
                                                </p>
                                            </div>
                                            <div class="commentContent">
                                                <p>
                                                    {$commentItem.maintext}
                                                </p>
                                            </div>
                                        </div>
                                    {/foreach}
                                </div>
                                {if count($comments)>0}
                                    <div class="postListItemRedLine">
                                    </div>
                                {/if}
                                <div class="postListItemCommentsList">
                                    <div class="commentList">
                                        {if count($leftIndexes)>1 || count($centerIndexes)>1 || count($rightIndexes)>1}
                                            <div class="pageListBgLeft">
                                                {if $pagenum != 1}
                                                <a href="/new{$newid}.html/{$pagenum-1}/"> << </a>
                                                {/if}
                                            </div>

                                            <div class="pageListBgCenter">
                                                {if count($leftIndexes)>0}
                                                {foreach from=$leftIndexes item=curIndex}
                                                {if $pagenum == $curIndex}
                                                <span style="font-weight: bold">&nbsp; {$curIndex} &nbsp; </span>
                                                {else}
                                                &nbsp; <a href="/new{$newid}.html/{$curIndex}/"> {$curIndex} </a> &nbsp;
                                                {/if}
                                                {/foreach}
                                                {if count($centerIndexes)>0}
                                                ...
                                                {/if}
                                                {/if}
                                                {if count($centerIndexes)>0}
                                                {foreach item=curIndex from=$centerIndexes}
                                                {if $pagenum == $curIndex}
                                                <span style="font-weight: bold">&nbsp; {$curIndex} &nbsp; </span>
                                                {else}
                                                &nbsp;<a href="/new{$newid}.html/{$curIndex}/"> {$curIndex} </a> &nbsp;
                                                {/if}
                                                {/foreach}
                                                {else}
                                                ...
                                                {/if}
                                                {if count($rightIndexes)>0}
                                                {if count($centerIndexes)>0}
                                                ...
                                                {/if}
                                                {foreach from=$rightIndexes item=curIndex}
                                                {if $pagenum == $curIndex}
                                                <span style="font-weight: bold">&nbsp; {$curIndex} &nbsp; </span>
                                                {else}
                                                &nbsp; <a href="/new{$newid}.html/{$curIndex}/"> {$curIndex} </a>  &nbsp;
                                                {/if}
                                                {/foreach}
                                                {/if}
                                            </div>

                                            <div class="pageListBgRight">
                                                {if $pagenum != $countPages}
                                                <a href="/new{$newid}.html/{$pagenum+1}/"> >> </a>
                                                {/if}
                                            </div>
                                            <span style="clear: both"></span>
                                        {/if}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="leftContentBgBottom">
                    </div>
                </div>
                {include file="globals/right.html"}
            </div>
        </div>
        {include file="globals/footer.html"}
    </body>
    {/strip}
</html>
